package edu.gyc.swing.test;

import java.io.File;
import java.io.FilenameFilter;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

public class Hi {
    public static void main(String[] args) {
        File file = new File("k:/girls/10694");
        String[] names = file.list(new FilenameFilter() {
            @Override
            public boolean accept(File dir, String name) {
                if (name.endsWith("jpg")) {
                    return true;
                }
                return false;
            }
        });

        String str = "00000";
        for (int i = 0; i < names.length; i++) {
            String name=names[i].substring(0,names[i].indexOf("."));
            names[i]=str.substring(0,5-name.length())+name;
            System.out.println(names[i]);

        }
        List<String > nameList=Arrays.asList(names);
        System.out.println(nameList);
        Collections.sort(nameList);
        System.out.println(nameList);
    }
}
